Skip to contentSkip to conversation

Change in openvpn[master]: pkcs11_management_id_get: Free certificate object after use

Openvpn-devel In review selvanair (Code Review) 2 participants 6 messages Oct 27, 2025 – Oct 28, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1761596820000.I85320b8f1cfc02dfd561916e5637d9481edac59e@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email

to review the following change.

Change subject: pkcs11_management_id_get: Free certificate object after use
......................................................................

pkcs11_management_id_get: Free certificate object after use

Found by ZeroPath

Change-Id I85320b8f1cfc02dfd561916e5637d9481edac59e

---
M src/openvpn/pkcs11.c

1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/17/1317/1

src/openvpn/pkcs11.c +3 -3
index ce64135..9afb181 100644
@@ -436,9 +436,6 @@
 {
     pkcs11h_certificate_id_list_t id_list = NULL;
     pkcs11h_certificate_id_list_t entry = NULL;
-#if 0 /* certificate_id seems to be unused -- JY */
-    pkcs11h_certificate_id_t certificate_id = NULL;
-#endif
     pkcs11h_certificate_t certificate = NULL;
     CK_RV rv = CKR_OK;
     unsigned char *certificate_blob = NULL;
@@ -548,6 +545,9 @@
     pkcs11h_certificate_freeCertificateIdList(id_list);
     id_list = NULL;
 
+    pkcs11h_certificate_freeCertificate(certificate);
+    certificate = NULL;
+
     free(internal_id);
     internal_id = NULL;
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I85320b8f1cfc02dfd561916e5637d9481edac59e
Gerrit-Change-Number: 1317
Gerrit-PatchSet: 1
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, selvanair.

plaisthos has posted comments on this change by selvanair. ( http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email )

Change subject: pkcs11_management_id_get: Free certificate object after use
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I85320b8f1cfc02dfd561916e5637d9481edac59e
Gerrit-Change-Number: 1317
Gerrit-PatchSet: 1
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: selvanair <[email protected]...>
Gerrit-Comment-Date: Mon, 27 Oct 2025 21:19:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 pkcs11_management_id_get: Free certificate object after use

In reply to a message not in the archive

From: Selva Nair <[email protected]...>

Found by ZeroPath

Change-Id I85320b8f1cfc02dfd561916e5637d9481edac59e

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1317
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1317
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

src/openvpn/pkcs11.c +3 -3
index ce64135..9afb181 100644
@@ -436,9 +436,6 @@
 {
     pkcs11h_certificate_id_list_t id_list = NULL;
     pkcs11h_certificate_id_list_t entry = NULL;
-#if 0 /* certificate_id seems to be unused -- JY */
-    pkcs11h_certificate_id_t certificate_id = NULL;
-#endif
     pkcs11h_certificate_t certificate = NULL;
     CK_RV rv = CKR_OK;
     unsigned char *certificate_blob = NULL;
@@ -548,6 +545,9 @@
     pkcs11h_certificate_freeCertificateIdList(id_list);
     id_list = NULL;
 
+    pkcs11h_certificate_freeCertificate(certificate);
+    certificate = NULL;
+
     free(internal_id);
     internal_id = NULL;
 
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: pkcs11_management_id_get: Free certificate object after use

I have not reviewed/tested this beyond "BB compiles things, unit tests (including pkcs11 on some of the instances) work". Stare-at-code looks very trivially correct.

Your patch has been applied to the master branch.

commit 87f639c820b8365585fc825ee7ea9cdd86cf88c5

Author: Selva Nair
Date:   Mon Oct 27 22:27:41 2025 +0100
     pkcs11_management_id_get: Free certificate object after use

     Signed-off-by: Selva Nair <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1317
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg33908.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by selvanair. ( http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

Change subject: pkcs11_management_id_get: Free certificate object after use
......................................................................

pkcs11_management_id_get: Free certificate object after use

Found by ZeroPath

Change-Id I85320b8f1cfc02dfd561916e5637d9481edac59e

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1317
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33908.html

---
M src/openvpn/pkcs11.c

1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/17/1317/2

src/openvpn/pkcs11.c +3 -3
index ce64135..9afb181 100644
@@ -436,9 +436,6 @@
 {
     pkcs11h_certificate_id_list_t id_list = NULL;
     pkcs11h_certificate_id_list_t entry = NULL;
-#if 0 /* certificate_id seems to be unused -- JY */
-    pkcs11h_certificate_id_t certificate_id = NULL;
-#endif
     pkcs11h_certificate_t certificate = NULL;
     CK_RV rv = CKR_OK;
     unsigned char *certificate_blob = NULL;
@@ -548,6 +545,9 @@
     pkcs11h_certificate_freeCertificateIdList(id_list);
     id_list = NULL;
 
+    pkcs11h_certificate_freeCertificate(certificate);
+    certificate = NULL;
+
     free(internal_id);
     internal_id = NULL;
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I85320b8f1cfc02dfd561916e5637d9481edac59e
Gerrit-Change-Number: 1317
Gerrit-PatchSet: 2
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email )

Change subject: pkcs11_management_id_get: Free certificate object after use
......................................................................

pkcs11_management_id_get: Free certificate object after use

Found by ZeroPath

Change-Id I85320b8f1cfc02dfd561916e5637d9481edac59e

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1317
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33908.html

---
M src/openvpn/pkcs11.c

1 file changed, 3 insertions(+), 3 deletions(-)
src/openvpn/pkcs11.c +3 -3
index ce64135..9afb181 100644
@@ -436,9 +436,6 @@
 {
     pkcs11h_certificate_id_list_t id_list = NULL;
     pkcs11h_certificate_id_list_t entry = NULL;
-#if 0 /* certificate_id seems to be unused -- JY */
-    pkcs11h_certificate_id_t certificate_id = NULL;
-#endif
     pkcs11h_certificate_t certificate = NULL;
     CK_RV rv = CKR_OK;
     unsigned char *certificate_blob = NULL;
@@ -548,6 +545,9 @@
     pkcs11h_certificate_freeCertificateIdList(id_list);
     id_list = NULL;
 
+    pkcs11h_certificate_freeCertificate(certificate);
+    certificate = NULL;
+
     free(internal_id);
     internal_id = NULL;
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1317?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I85320b8f1cfc02dfd561916e5637d9481edac59e
Gerrit-Change-Number: 1317
Gerrit-PatchSet: 2
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>